<script setup>
import Child from './Child.vue';
import MyComponent from './MyComponent.vue';

const message = '来自父组件的消息';

const handleCustomEvent = (message) => {
    console.log(message);
};
</script>

<template>
  <div>
    <h2>父组件</h2>
    <p>这是父组件页面</p >
    <MyComponent :msg="message"></MyComponent>
    <Child @custom-event="handleCustomEvent"></Child>
  </div>
</template>